/* 全局样式 - 确保无滚动条 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden; /* 禁用全局滚动 */
    font-family: Arial, sans-serif;
}

.wrapper {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* 左侧面板 */
.sidebar {
    width: 250px;
    height: 100vh;
    background-color: #f8f9fa;
    padding: 20px 15px;
    border-right: 1px solid #dee2e6;
    overflow-y: auto; /* 仅允许侧边栏内部滚动 */
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #212529;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.sidebar button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar button:hover {
    background-color: #5a6268;
}

.system-info {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.system-info h3 {
    font-size: 14px;
    color: #495057;
}

/* 右侧内容区 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
    overflow: hidden; /* 禁用滚动 */
}

#chartContainer {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 0; /* 修复Flexbox计算问题 */
    margin-bottom: 100px;
    margin-top: 100px;
}

/* 图表画布 */
#chartCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 切换按钮 */
.toggle-buttons {
    position: absolute;
    right: 20px;
    bottom: 50px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.toggle-button {
    padding: 6px 12px;
    background-color: #108dec;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-button:hover {
    background-color: #36bbe4;
}

.toggle-button.toggle-on {
    background-color: #191cd3;
}

#showFemaleOnly {
    background-color: #ff6384;
}

#showFemaleOnly:hover {
    background-color: #ff8fa3;
}

#showFemaleOnly.toggle-on {
    background-color: #c2185b;
}

/* 页脚 */
.footer {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* 数据表单样式 */
#dataForm {
    margin-top: 20px;
}

.dataItem {
    background: white;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.input-group input {
    padding: 5px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    width: 60px;
}

.remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}

/* 添加拖动交互时的光标样式 */
#chartCanvas {
    cursor: default;
}

/* 高亮被拖动的柱子 */
.chartjs-render-monitor .bar:hover {
    opacity: 0.9;
    transition: opacity 0.2s;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.color-picker {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.color-picker label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    cursor: pointer;
}

#applyColors {
    padding: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#applyColors:hover {
    background-color: #45a049;
}